
import { AxiosPromise } from "axios";
import IUserinfo from "./IUserinfo";
import { get, del, post } from "../http"
import api from "../api";
import userModel from "../userModel";

class Userinfo implements IUserinfo {
    login(data: userModel): AxiosPromise<any> {
        return get(api.login, data);
    }
    add(data: userModel): AxiosPromise<any> {
        return post(api.userinfo, data);
    }
    del(id: number): AxiosPromise<any> {
        return del(api.userinfo + "/" + id);
    }
    query(params?: any): AxiosPromise<any> {
        return get(api.query, params);
    }

}

export default new Userinfo();